<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('题目汇总')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="role-form">
					<div class="select-list">
						<ul>
							<li>
								试卷名称：<input type="text" name="roleName"/>
							</li>
							<li>
								状态：<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
									<option value="">所有</option>
									<option value="">启用</option>
									<option value="">禁用</option>
								</select>
							</li>
							<li>
								出题类型：<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
									<option value="">所有</option>
									<option value="">随机试卷</option>
									<option value="">固定试卷</option>
<!-- 									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> -->
								</select>
							</li>
							<li class="select-time">
								<label>创建时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
		
			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:role:add">
	                <i class="fa fa-plus"></i> 创建试卷
	            </a>
				<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:role:remove">
		            <i class="fa fa-remove"></i> 删除
		        </a>
	        </div>
	        
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "exam/paper";
        var datas = [[${@dict.getType('sys_normal_disable')}]];

        $(function() {
            var options = {
                url: prefix + "/list",
		        showFooter: true,
		        showSearch: true,
		        showRefresh: true,
		        showToggle: true,
		        showColumns: true,
		        footerStyle: footerStyle,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'userId', 
					title : '试卷名称'
				},
				{
					field : 'userCode', 
					title : '试卷状态'
				},
				{
					field : 'userName', 
					title : '出题类型'
				},
				{
					field : 'userPhone', 
					title : '更新时间'
				},
				{
					field : 'userPhone', 
					title : '创建时间'
				},
				{
					field : 'userEmail', 
					title : '创建人'
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
		            	actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-remove"></i>删除</a> ');
                        actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-add"></i>邀请考生</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
        
        function footerStyle(column) {
        	return {
//         	    userBalance: {
//         	        classes: 'class'
//         	    },
        	    userBalance: {
        	        css: { color: 'red', 'font-weight': 'normal' }
        	    }
        	}[column.field]
          }
    </script>
</body>
</html>